package com.itheima.activiti.controller.system;

import com.itheima.activiti.common.R;
import com.itheima.activiti.dto.system.RoleDTO;
import com.itheima.activiti.service.system.RoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/role")
@Api(tags = "角色接口")
public class RoleController {

    @Autowired
    private RoleService roleService;

    @ApiOperation("查询全部角色")
    @GetMapping(value = "/list")
    public R<List<RoleDTO>> list() {
        List<RoleDTO> roleDTOS = roleService.list();
        return R.success(roleDTOS);
    }

}
